home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 16024 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  5.7 KB

  1. Path: ix.netcom.com!news
  2. From: giuliano@ix.netcom.com(Giuliano Carlini)
  3. Newsgroups: comp.lang.c++
  4. Subject: Would/Won't you use a garbage collector?
  5. Date: 8 Apr 1996 09:34:06 GMT
  6. Organization: Netcom
  7. Message-ID: <4kamie$e4d@dfw-ixnews3.ix.netcom.com>
  8. NNTP-Posting-Host: lbx-ca6-13.ix.netcom.com
  9. X-NETCOM-Date: Mon Apr 08  4:34:06 AM CDT 1996
  10.  
  11. I'm a long time proponent of using garbage collection in C and C++
  12. programs, and I'm curious:
  13.     - How many others are there?
  14.     - Why don't most C/C++ programmers use it?
  15. I'm particularly interested in finding out why most C/C++ don't use it.
  16. While I have my own theories - which I'll describe below - I'm
  17. interested
  18. in finding out more directly from those who are against it. I've spent
  19. a
  20. good part of the past 4 years trying to convince people to use it, and
  21. I've got a handle on why the small group of people I associate with are
  22. not using it, but I'd like to find out more about why the C/C++
  23. community
  24. as a whole does not.
  25.  
  26. I hope that with this information, I'll be able to perfect a more
  27. convincing presentation for why the default should be to use garbage
  28. collection, and for why explicit calls to free/delete should be used
  29. only
  30. in the rare cases for which garbage collection is inappropriate.
  31.  
  32. What follows is my belief for why garbage collection is so little used.
  33. Feel free to respond to anything I say below, but please, first respond
  34. to the questions above. I believe that most people don't use garbage
  35. collection because either they:
  36.     - don't know what it is
  37.     - don't know it can be used with C/C++.
  38.     - are misinformation
  39.     - are biased against it by the C/C++ culture
  40. In my experience, most C/C++ programmers either don't know what garbage
  41. collection is, or don't know that it can be used with C/C++. After all,
  42. no major C/C++ compiler includes a garbage collector. At least, as far
  43. as I know. I hope I'm wrong, and that someone can correct me. But even
  44. after, I tell them what it is, and that it can be used with C++, almost
  45. everyone still rejects it. 
  46.  
  47. At first, most offer technical reasons for rejecting it. Almost all are
  48. based on misinformation, since garbage collection is usable and
  49. benificial
  50. for the vast majority of systems. The most often mentioned is that
  51. From: giuliano@ix.netcom.com(Giuliano Carlini)
  52. Newsgroups: comp.lang.c++
  53. Subject: Would/Won't you use a garbage collector?
  54.  
  55. I'm a long time proponent of using garbage collection in C and C++
  56. programs, and I'm curious:
  57.     - How many others are there?
  58.     - Why don't most C/C++ programmers use it?
  59. I'm particularly interested in finding out why most C/C++ don't use it.
  60. While I have my own theories - which I'll describe below - I'm
  61. interested
  62. in finding out more directly from those who are against it. I've spent
  63. a
  64. good part of the past 4 years trying to convince people to use it, and
  65. I've got a handle on why the small group of people I associate with are
  66. not using it, but I'd like to find out more about why the C/C++
  67. community
  68. as a whole does not.
  69.  
  70. I hope that with this information, I'll be able to perfect a more
  71. convincing presentation for why the default should be to use garbage
  72. collection, and for why explicit calls to free/delete should be used
  73. only
  74. in the rare cases for which garbage collection is inappropriate.
  75.  
  76. What follows is my belief for why garbage collection is so little used.
  77. Feel free to respond to anything I say below, but please, first respond
  78. to the questions above. I believe that most people don't use garbage
  79. collection because either they:
  80.     - don't know what it is
  81.     - don't know it can be used with C/C++.
  82.     - are misinformation
  83.     - are biased against it by the C/C++ culture
  84. In my experience, most C/C++ programmers either don't know what garbage
  85. collection is, or don't know that it can be used with C/C++. After all,
  86. no major C/C++ compiler includes a garbage collector. At least, as far
  87. as I know. I hope I'm wrong, and that someone can correct me. But even
  88. after, I tell them what it is, and that it can be used with C++, almost
  89. everyone still rejects it. 
  90.  
  91. At first, most offer technical reasons for rejecting it. Almost all are
  92. based on misinformation, since garbage collection is usable and
  93. benificial
  94. for the vast majority of systems. The most often mentioned is that
  95. although
  96. I sure try. The crux of cultural reason against garbage collection is
  97. that
  98. relying on a garbage collector is "sloppy". The "Code talk" note in the
  99. January Byte is a great example of this thinking. This sort of C/C++
  100. programmer believes that it is just wrong to not explicitly call
  101. delete.
  102. That if you don't, your an undisciplined hack. That if you don't,
  103. you've
  104. turned to the dark side and surely will come to a bad end.
  105.  
  106. I'm not sure how to address this. My current argument seems to get them
  107. thinking, but isn't immediately convincing. Anyone have any ideas on a
  108. better approach. Or perhaps on a better presentation. My argument is
  109. that
  110. computers are very good at mechanistic, repetitive tasks. And that
  111. people
  112. are usually pretty bad at them; being mechanistic and repetitive, these
  113. tasks are rather boring, which means that our attention often strays.
  114. People
  115. routinely turn over such tasks to computers. For example, bookkeeping
  116. or
  117. inventory control. And what else is memory deallocation but a sort of
  118. bookkeeping or inventory control. It's just that rather than being for
  119. a resource outside of the computer it is for one inside.
  120.  
  121. For anyone who may be wondering, I believe that we should use garbage
  122. collection because:
  123.     - It vastly decreases the number of bugs in programs which use
  124. it.
  125.     - It vastly decreases the time to complete programs which use
  126. it.
  127.     - It vastly increases the understandability, reuseability,
  128.         extensability, and maintainability of programs which use
  129. it.
  130.  
  131. So, do you use garbage collection in your C/C++ programs, and if not,
  132. why not?
  133.  
  134. giuliano
  135.